
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><?php echo $title;?></title>
    <!-- 设置缩放 -->
    <meta name="viewport" content="minimal-ui,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <!-- IOS中禁用将数字识别为电话号码/忽略Android平台中对邮箱地址的识别 -->
    <meta name="format-detection" content="telephone=no" />
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no" />
    <!-- icon -->
    <link rel="shortcut icon" href="<?php echo ADMIN_ICO_PIC;?>" type="image/x-icon"/>
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SYS_LINK;?>admin/css/content.css?v=<?php echo V_CSSJS;?>" />
    <style>

    </style>
</head>
<body>
<div class="con_box">
    <div class="titleH18">模型修改</div>
    <form class="form_box">
        <input type="hidden" name="id" value="<?php echo $info['id']?>" />
        <input type="hidden" name="mouldcode" value="<?php echo $info['mouldcode']?>" />
        <div class="form_item">
            <label>模型名称</label>
            <input type="text" name="mouldname" value="<?php echo $info['mouldname']?>" autocomplete="off" placeholder="请输入">
            <i class="hint">* (必填)</i>
        </div>
        <div class="form_item">
            <label>模型编码</label>
            <input type="text" value="<?php echo $info['mouldcode']?>" disabled="true">
            <i class="hint">* 添加时定义，以后不可更改</i>
        </div>
        <div class="form_item">
            <label>模型排序</label>
            <input type="number" name="viewseq" value="<?php echo $info['viewseq']?>" autocomplete="off" placeholder="显示排序顺序" class="input100">
            <i class="hint">* (必填)必须正整数，显示排序顺序，越大越靠前，默认0</i>
        </div>
        <div class="form_item">
            <label>模型状态</label>
            <?php
            $status1 = $info['status'] == 1 ? 'checked="checked"' : '';
            $status2 = $info['status'] == 2 ? 'checked="checked"' : '';
            ?>
            <label class="radio"><input type="radio" value="1" name="status" <?php echo $status1;?> >开启</label>
            <label class="radio"><input type="radio" value="2" name="status" <?php echo $status2;?> >关闭</label>
            <i class="hint">* (必选)展示状态</i>
        </div>
        <div class="form_item">
            <label>多个关联</label>
            <?php
            $classflag1 = $info['classflag'] == 1 ? 'checked="checked"' : '';
            $classflag2 = $info['classflag'] == 2 ? 'checked="checked"' : '';
            ?>
            <label class="radio"><input type="radio" value="1" name="classflag" <?php echo $classflag1;?> >开启</label>
            <label class="radio"><input type="radio" value="2" name="classflag" <?php echo $classflag2;?> >关闭</label>
            <i class="hint">* (必选)文章内容多菜单关联</i>
        </div>
        <div class="form_item">
            <label>内容子集</label>
            <?php
            $sideflag1 = $info['sideflag'] == 1 ? 'checked="checked"' : '';
            $sideflag2 = $info['sideflag'] == 2 ? 'checked="checked"' : '';
            ?>
            <label class="radio"><input type="radio" value="1" name="sideflag" <?php echo $sideflag1;?> >开启</label>
            <label class="radio"><input type="radio" value="2" name="sideflag" <?php echo $sideflag2;?> >关闭</label>
            <i class="hint">* (必选)文章内容子集列表</i>
        </div>
        <div class="form_item">
            <label>字段模版</label>
            <?php
            $tmplflag1 = $info['tmplflag'] == 1 ? 'checked="checked"' : '';
            $tmplflag2 = $info['tmplflag'] == 2 ? 'checked="checked"' : '';
            ?>
            <label class="radio"><input type="radio" value="1" name="tmplflag" <?php echo $tmplflag1;?> >开启</label>
            <label class="radio"><input type="radio" value="2" name="tmplflag" <?php echo $tmplflag2;?> >关闭</label>
            <i class="hint">* (必选)文章详情关联自定义字段列表</i>
        </div>
        <div class="form_item">
            <label style="color:#ff7f77"> 编辑需保存 </label>
            <input type="button" id="sub_btn" value="提交保存" class="btn_base btn_back_sides btn_w300 btn_height35 btn_radius5">
        </div>
    </form>
</div>
</body>
<script language="javascript">
    var http_url = '<?php echo SYS_HOST;?>';
    var http_link = '<?php echo SYS_LINK;?>';
    var cssjsv = '<?php echo V_CSSJS;?>';
    var http_fix = '<?php echo SYS_URL_FIX;?>';
</script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/jquery.min.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/skin.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/common.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript">file_load('info');</script>
<script language="javascript">

    // 加载完毕后
    window.onload = function () {

    }
    var flagSub = true;
    var gotoUrl = '<?php echo SYS_URL_PATH('admin_mould_update');?>';
    $(function(){
        $('#sub_btn').on('click',function(){
            var fromBox = $('.form_box');
            var param = getFormData(fromBox);
            param.append('subFlag', 'Y'); // 追加参数
            layer.confirm('确定修改？配置变更时会影响数据表结构', {
                btn: ['确定','取消']
            }, function(){
                if(!flagSub){
                    layer.msg('处理中……(禁止重复提交)');return false;
                }
                flagSub = false;
                $.ajax({
                    url:gotoUrl,
                    dataType:'json',
                    type:'POST',
                    async: false,
                    data: param,
                    processData : false, // 使数据不做处理
                    contentType : false, // 不要设置Content-Type请求头
                    success: function(data){
                        flagSub = true;
                        if(data=='Y'){
                            layer.msg('修改成功');
                            setTimeout(function(){
                                parent.location.reload();
                            },2500);
                        }else{
                            layer.msg('操作失败_'+data);
                        }
                    },
                    error:function(response){
                        flagSub = true;
                        layer.msg('网络异常');
                        console.log('网络异常：'+response);
                    }
                });
            }, function(){ });
        })
    })
</script>
</html>